import axios from '@/utils/request';

//获取所有问题
export function getProblemList(current: number, size: number) {
    return axios({
        url: `/answer/problem/getProblemList/${current}/${size}`,
        method: "get"
    })
}

//新增问题
export function addProblem(problem: object) {
    return axios({
        url: "/answer/problem/addProblem",
        method: "post",
        data: problem
    })
}

//修改问题
export function updateProblem(problem: object) {
    return axios({
        url: "/answer/problem/updateProblem",
        method: "put",
        data: problem
    })
}

//删除问题
export function deleteProblem(ids: []) {
    return axios({
        url: "/answer/problem/deleteProblem/" + ids,
        method: "delete"
    })
}

//根据id获取问题信息
export function getProblem(id: number) {
    return axios({
        url: "/answer/problem/" + id,
        method: "get"
    })
}

//搜索
export function searchProblem(problemParams: object) {
    return axios({
        url: "/answer/problem/searchProblem",
        method: "post",
        data: problemParams
    })
}

//导出
export function exportProblem() {
    return axios({
        url: "/answer/problem/exportProblem",
        method: "get",
        responseType: 'blob',
    })
}